In C++, communication is a flow, not a static storage event. The iostream library utilizes a polymorphic hierarchy where specialized classes like ifstream (files) and istringstream (memory) inherit from istream. This enables Stream Inheritance: functions designed for a base stream can transparently process data from any source.
The Non-Copyable Constraint
Streams represent unique, stateful connections to hardware. To prevent multiple objects from fighting over the same file pointer or console buffer, IO objects cannot be copied or assigned. Attempting code like ofstream out1, out2; out1 = out2; results in a compiler error. Consequently, IO objects must be passed by non-const reference.
The Sequential Bridge
While streams provide the interface, sequential containers (vector, list) provide the memory. Data streamed in is typically structured into these containers, choosing vector for speed or list for flexible insertions.